package com.starlink.model.util;

import com.starlink.model.dtomapper.CheckInRecordsDtoMapper;
import com.starlink.model.domain.CheckInRecordsDO;
import com.starlink.model.vo.CheckInRecordsVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class CheckInRecordsConvert {

    public static List<CheckInRecordsVO> buildCheckInRecordsVoList(List<CheckInRecordsDO> checkInRecordsDOList) {
        if (CollectionUtils.isEmpty(checkInRecordsDOList)) {
            return Lists.newArrayList();
        }
        List<CheckInRecordsVO> checkInRecordsVOList = new ArrayList<>();
        for (CheckInRecordsDO checkInRecordsDO : checkInRecordsDOList) {
            checkInRecordsVOList.add(CheckInRecordsDtoMapper.INSTANCE.do2VO(checkInRecordsDO));
        }

        return checkInRecordsVOList;
    }
}
